UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdF7PtMGn4suvcQd1YtC12pUz77VdhDGMz/lLBHFGbY=' 
WHERE 
  key_id = 'f08f3ef21bf6fb3cce14a583586e1c72b4b6ddd61f7e967199562ccb8d6b83a9' 
  AND (
    token = 'rdF7PtMGn4suvcQd1YtC12pUz77VdhDGMz/lLBHFGbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049