UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dYFfpw8jGwMwuikl/Oo/VMxLYBaqT9LV+RAtRfHt78c=' 
WHERE 
  key_id = '6235fd37dc5d2ec7ce4c82ce7b290a3d08e855fa84c121286cbadba58e89fdf3' 
  AND (
    token = 'dYFfpw8jGwMwuikl/Oo/VMxLYBaqT9LV+RAtRfHt78c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046