UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ec3YiNg92sMQRlDC+99EjMrk/nHOyK/RyimoAFUpdU=' 
WHERE 
  key_id = 'd752b0f27fa1c5b395c5ba8b7049ce70d9bd40a9c1ffee6a4db0b3b71fbf559a' 
  AND (
    token = '8ec3YiNg92sMQRlDC+99EjMrk/nHOyK/RyimoAFUpdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036