UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GVEwUs/f27FD8hXkrb8W8iDvxNwIvU1zotfMOkLAWgg=' 
WHERE 
  key_id = 'ac583dd6e6b147a549a0a99ee272dbfd94abda51da49145bb398c89cb2c0d230' 
  AND (
    token = 'GVEwUs/f27FD8hXkrb8W8iDvxNwIvU1zotfMOkLAWgg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028