UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ty8VupfDrpJQHhfZE5uig2Wjsq+M2y+H3b5OlSfiIYQ=' 
WHERE 
  key_id = '43254faf9eb89cfabce3ea8dd33528354fd093636dae994050ac2a5d8ce261b0' 
  AND (
    token = 'Ty8VupfDrpJQHhfZE5uig2Wjsq+M2y+H3b5OlSfiIYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047