UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EdMR9hogtKvmGH+Rj+YSeo27rLFPSboHWhHkLxLRQM8=' 
WHERE 
  key_id = '5cbb2c3c4172c97bb1d9d9b72e7198cbe91aa908cfada75ddbd5547d559acce1' 
  AND (
    token = 'EdMR9hogtKvmGH+Rj+YSeo27rLFPSboHWhHkLxLRQM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071