UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dasbSEC2KU4QcNLBlT3qwN7lPln90+23Rkb9DE4Cl84='
WHERE
key_id = 'ac07468abac87cee4e9fc6a20595f54ea3888be862274e033cf4275ae0b9945b'
AND (
token = 'dasbSEC2KU4QcNLBlT3qwN7lPln90+23Rkb9DE4Cl84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)