UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '21q1TLdqgJ/NqceTT5SOiz23roO5ndRPplxZ2Iw+SIg='
WHERE
key_id = '0d5337fcfeec8b60bfea58676aa6d7aab61927e3d68426d958ebd180bd138e94'
AND (
token = '21q1TLdqgJ/NqceTT5SOiz23roO5ndRPplxZ2Iw+SIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)