UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xbik0SzBIWtBnkG1jvTWmfPvyy9XcPleGYwhP5mKmBI='
WHERE
key_id = 'dad76ec98a0e0d52021f9136b32eb4f5facfb2983cd8820b4e4004bfbef854dd'
AND (
token = 'Xbik0SzBIWtBnkG1jvTWmfPvyy9XcPleGYwhP5mKmBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)