UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+AsPJ9FGs607xuXL3mwSi3FBjgdzdJYUr5bvRXKGwWY='
WHERE
key_id = '303648e591b3d04eff440c70854168fd58b9e607e1f7c6a896f319be8ca59363'
AND (
token = '+AsPJ9FGs607xuXL3mwSi3FBjgdzdJYUr5bvRXKGwWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)