UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'swLu46Rk1UwB+xd7Q9jyAXrdH9pIR2dcY7e/3lRAxIc='
WHERE
key_id = 'd6e5ea8c929053656536179fa5dbbf8454d2d9694fbd6a1043168b4616caabe4'
AND (
token = 'swLu46Rk1UwB+xd7Q9jyAXrdH9pIR2dcY7e/3lRAxIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)