UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I44NoyDaVQz6Dg4kHojJbgc3PAkSqDlTW1aD/2NFn/M='
WHERE
key_id = 'b624ec215ae395df57ada7caea981044522039328ffb0641ab3da918c7e2c7b9'
AND (
token = 'I44NoyDaVQz6Dg4kHojJbgc3PAkSqDlTW1aD/2NFn/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)