UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z5e3mgYP4nbjxzyh0iKIqhRGEv0D8OAuVXQGLDi6OoI='
WHERE
key_id = 'df8fb765ad71c7316624c1426f89ee13a417e18683e5ed8caf2e192b713e0c63'
AND (
token = 'Z5e3mgYP4nbjxzyh0iKIqhRGEv0D8OAuVXQGLDi6OoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)