UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rUMYUVT1qp8MXVTqsR0oAhuCempJD9I0nS7sJ92J+kA=' 
WHERE 
  key_id = '8fb7e0a8e72e62d29711c9cdf887961e3c6838968bcea01e4b0d9fdbc875407c' 
  AND (
    token = 'rUMYUVT1qp8MXVTqsR0oAhuCempJD9I0nS7sJ92J+kA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033