UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmy7tlYC7rk5/nrxjgHBEsTPSw0Li08xqQPOYuiszc0=' 
WHERE 
  key_id = '2897fe56a1029fd0374e0430615f30b4edd095b73772e47ab4b99f9bcdb76cb0' 
  AND (
    token = 'zmy7tlYC7rk5/nrxjgHBEsTPSw0Li08xqQPOYuiszc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020