UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mVJNU7lEvozmG+Z7WOpbNDgVCDWvGlc60qkMYsWUey0=' 
WHERE 
  key_id = '1be43089f6c4b9a0a800d8d5e4c47b4c113b4f39f9f37a05ca65a9e3684558b8' 
  AND (
    token = 'mVJNU7lEvozmG+Z7WOpbNDgVCDWvGlc60qkMYsWUey0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038