UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UnmO8ZZLZRS01nwyrBdQWH0VGuJNzSdwAKz12gAtQo='
WHERE
key_id = 'a77d679bd30117a2e7e03d6ec36c90761a4d9314fa896fed41084d57b163d482'
AND (
token = '4UnmO8ZZLZRS01nwyrBdQWH0VGuJNzSdwAKz12gAtQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)