UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l6C3aw/kzyx/wel85LQNs+Zogyzo/ocP5Fa0uXbLJSQ=' 
WHERE 
  key_id = '94243bd287b68a07d8106fb4d29b1d13303a0f04557925aff7fdc1786517094b' 
  AND (
    token = 'l6C3aw/kzyx/wel85LQNs+Zogyzo/ocP5Fa0uXbLJSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068