UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13C2afLdAF3WeZwdHByWTq2zJHalAtSnLgsOCGhzc7k='
WHERE
key_id = '42ace15826cfb9e4d6ffe387cdc3cdc34fc43fd76c4f755da04460a76182654f'
AND (
token = '13C2afLdAF3WeZwdHByWTq2zJHalAtSnLgsOCGhzc7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)