UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7C/oXaxISFZcd6RVCY4TCNGYH+sOpaxWsTILhOMOXPM=' 
WHERE 
  key_id = 'b5986cfd5196ce6a8a92935bcb9860c58bcbe8dd08df810f24392efb7ebefc32' 
  AND (
    token = '7C/oXaxISFZcd6RVCY4TCNGYH+sOpaxWsTILhOMOXPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059