UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYJt+MZNS64DnvzolFDSTA5Ib03de4C+C99qikTr8ss='
WHERE
key_id = '9eac08c3c1fde681ffd9dee39d3524c623b7e9ba4f06220a81448bc5b432915c'
AND (
token = 'JYJt+MZNS64DnvzolFDSTA5Ib03de4C+C99qikTr8ss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)