UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SFMW1qIz5xgrDfGDfUZ22KnDtxGnoniod0FCZrDLo0w='
WHERE
key_id = '2411d08489a1906b27e473901b77c278ecb33037457b032faab37170443dc941'
AND (
token = 'SFMW1qIz5xgrDfGDfUZ22KnDtxGnoniod0FCZrDLo0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)