UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D6bzGz/blTsFdJ9a44ddiJ03mIIYlRRCvMLJS/Cp+4s=' 
WHERE 
  key_id = '9624ffb1a1d94e38bc2d80fc48a7ad7aa3cd9ec777b6f469ded26635d4473e09' 
  AND (
    token = 'D6bzGz/blTsFdJ9a44ddiJ03mIIYlRRCvMLJS/Cp+4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049