UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '92YYW+NkW+D5FPopjE0LZIgmhf+UvrMA83vDvjoG2Lw=' 
WHERE 
  key_id = '3d92a4217d04bc9f9e06c227537efb84ee3fa40c81af598933d5db124b6ba6ec' 
  AND (
    token = '92YYW+NkW+D5FPopjE0LZIgmhf+UvrMA83vDvjoG2Lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026