UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qP2Sy7pFulm0t9xz69NUuVuc93P1KAQr/XJF885Mq4='
WHERE
key_id = '6be35953096b9a34a02f9f5b569dbbb275f10458832a1ddee772d41a71fa3dcb'
AND (
token = '8qP2Sy7pFulm0t9xz69NUuVuc93P1KAQr/XJF885Mq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)