UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zlcKMp2ngygL3GlhDLddjH2Ag3hXCAwhvkuq8IlaSk0=' 
WHERE 
  key_id = '294e4f1492b21800c00f966c72a31a6a66c8827b69b96da35d08c85629dbc25f' 
  AND (
    token = 'zlcKMp2ngygL3GlhDLddjH2Ag3hXCAwhvkuq8IlaSk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031