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