UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ljMAVVXXSowDkoFpZ6uIP8xbb19bbzjmKECvE7k7u68=' 
WHERE 
  key_id = '9efb7978cb2fdf0bda136dcc2a7f5c89eb623a6467ac76a1e1717b3b9ac9ee25' 
  AND (
    token = 'ljMAVVXXSowDkoFpZ6uIP8xbb19bbzjmKECvE7k7u68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034