UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AaPTOr4dKKdCxEiDxwlwlws5sza6OuIM3gK6S70gQh4='
WHERE
key_id = '2da53e4af7afcd1ad3f829ed2e6b8a114aefb09fed1000d2f95be2ad4974e0eb'
AND (
token = 'AaPTOr4dKKdCxEiDxwlwlws5sza6OuIM3gK6S70gQh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)