UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oCkTaCegCvB1Kl2aqJ6x7HlikaxqF6cVogkosGZW5dY=' 
WHERE 
  key_id = 'e49e750361c4ef4130663c430cc2ec723d6d73d17dc8474351c10a74fa97935b' 
  AND (
    token = 'oCkTaCegCvB1Kl2aqJ6x7HlikaxqF6cVogkosGZW5dY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031