UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+4sUUd49RBl7doTTIIVZ2A5HPqjFo7B32IT75s1lPg=' 
WHERE 
  key_id = 'c10c9401a012a16bc7ee8cd108b44b754f893411db98b5272f4ae5fe4cc53a73' 
  AND (
    token = 'k+4sUUd49RBl7doTTIIVZ2A5HPqjFo7B32IT75s1lPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048