UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZUb03/QRi64ONlzrLthbMJTsZLsLMjXapWGmPpLEZxk='
WHERE
key_id = '28a1d28323a0e790f8ef882bc67725db54899b184f6b525ace8ac3c27196b798'
AND (
token = 'ZUb03/QRi64ONlzrLthbMJTsZLsLMjXapWGmPpLEZxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)