UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WfDlVvwtty3WwN9BTi4aRhH/hYfg1YDwScFPeFvhMYg=' 
WHERE 
  key_id = '074391d048cde53a33dc27a0d71760b21ca5e724bf257fe1f232fa9be70f02b9' 
  AND (
    token = 'WfDlVvwtty3WwN9BTi4aRhH/hYfg1YDwScFPeFvhMYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027