UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O9YZ93MziQ6Y6uVqbexrDCiYrzBS0rBg4uY2GNWP8a0='
WHERE
key_id = '4e7c84bd97b3c8f69582009498d8ef0f41d9fd434a1329bc445b9d75d1daedf9'
AND (
token = 'O9YZ93MziQ6Y6uVqbexrDCiYrzBS0rBg4uY2GNWP8a0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)